<div class="content-wrapper">
    <?php
    $form = $this->form;
    $form->prepare();
    ?>
    <?php echo $this->form()->openTag($form); ?>
    <section class="content-header">
        <?php echo $this->partial('layout/breadcrumb'); ?>

        <h1 class="pull-right" id="dbshop-menu-top">
            <a href="<?php echo $this->url('goods-other-tag');?>" class="btn btn-default btn-sm"><i class="fa fa-arrow-left"></i> <?php echo $this->translate('返回聚合标签列表'); ?></a>
            <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-check"></i> <?php echo $this->translate('保存聚合标签'); ?></button>
            <?php echo $this->HelpUrl('goodsOtherTag'); ?>
        </h1>
    </section>

    <section class="content">

        <div class="row">
            <div class="col-md-12">
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab_1" data-toggle="tab"><?php echo $this->translate('基本信息'); ?></a></li>
                        <li><a href="#tab_2" data-toggle="tab"><?php echo $this->translate('SEO优化'); ?></a></li>
                    </ul>
                    <div class="tab-content">
                        <?php echo $this->partial('layout/messages'); ?>
                        <div class="tab-pane active" id="tab_1">
                            <div class="box-body">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('聚合标签名称'); ?><span class="must_add_value">*</span></label>
                                    <div class="col-sm-5">
                                        <?php echo $this->formElement($form->get('otherTagName')); ?>
                                        <?php echo $this->formElementErrors($form->get('otherTagName'), ['class'=>'error-message']); ?>
                                    </div>
                                    <p class="form-control-static text-sm text-primary"><?php echo $this->translate('用于后台显示'); ?></p>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('聚合标签标题'); ?><span class="must_add_value">*</span></label>
                                    <div class="col-sm-5">
                                        <?php echo $this->formElement($form->get('otherTagTitle')); ?>
                                        <?php echo $this->formElementErrors($form->get('otherTagTitle'), ['class'=>'error-message']); ?>
                                    </div>
                                    <p class="form-control-static text-sm text-primary"><?php echo $this->translate('用于前台显示'); ?></p>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('聚合标签状态'); ?></label>
                                    <div class="col-sm-3">
                                        <div class="checkbox">
                                            <label>
                                                <?php echo $this->formElement($form->get('otherTagState')); ?> <?php echo $this->translate('启用'); ?>
                                                <?php echo $this->formElementErrors($form->get('otherTagState'), ['class'=>'error-message']); ?>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane" id="tab_2">
                            <div class="box-body">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('关键字'); ?></label>
                                    <div class="col-sm-10">
                                        <?php echo $this->formElement($form->get('otherTagKeywords')); ?>
                                        <?php echo $this->formElementErrors($form->get('otherTagKeywords'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('描述'); ?></label>
                                    <div class="col-sm-10">
                                        <?php echo $this->formElement($form->get('otherTagDescription')); ?>
                                        <?php echo $this->formElementErrors($form->get('otherTagDescription'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </section>
    <?php echo $this->form()->closeTag(); ?>

</div>
<script type="text/javascript">
    $(document).ready(function() {
        $("#<?php echo $form->getName(); ?>").validate({
            rules: {
                otherTagName: {
                    required: true
                },
                otherTagTitle: {
                    required: true
                }
            },
            messages: {
                otherTagName: {
                    required: "<?php echo $this->translate('标签组名称不能为空!'); ?>"
                },
                otherTagTitle: {
                    required: "<?php echo $this->translate('排序不能为空!'); ?>"
                }
            }
        });
    });
</script>
